import Vue from 'vue'
import App from './App.vue'

import Buefy from 'buefy'
import 'buefy/dist/buefy.css'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import 'font-awesome/css/font-awesome.min.css'
import '@/assets/app.css'

import router from './router'
import store from './store'
import format from 'date-fns/format'
import '@/permission'
import relativeTime from 'dayjs/plugin/relativeTime'

import axios from 'axios' // 引入axios
Vue.prototype.$http = axios

import VueCropper from 'vue-cropper'
Vue.use(VueCropper)

import 'dayjs/locale/zh-cn'
import i18n from './i18n'
const dayjs = require('dayjs');

dayjs.extend(relativeTime)

dayjs.locale('zh-cn')
dayjs().locale('zh-cn').format()

Vue.prototype.dayjs = dayjs;

Vue.filter('date', (date) => {
    return format(new Date(date), 'yyyy-MM-dd')
})

Vue.use(Buefy)
Vue.use(ElementUI)

Vue.config.productionTip = false

new Vue({
    router,
    store,
    i18n,
    render: h => h(App),
}).$mount('#app')

